﻿using Common;
using DataLibrary;
using System;
using System.Windows.Forms;

namespace TicketSystem
{
    public partial class Form_SystemManage : Form
    {
        public Form_SystemManage()
        {
            InitializeComponent();
        }
        private TicketSystemEntities tse = new TicketSystemEntities();
        private PublicMethod pm = new PublicMethod();
        public UC_Guide guide;
        public UC_Travel travel;
        public UC_TravelType traveltype;
        public UC_Operators ope;
        public UC_RoleRight roleright;

        private void Form_SystemManage_Load(object sender, EventArgs e)
        {
            guide = new UC_Guide();
            travel = new UC_Travel();
            traveltype = new UC_TravelType();
            ope = new UC_Operators();
            roleright = new UC_RoleRight();
        }

        private void 操作员管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ope.Show();
            gpb_SystemManage.Controls.Clear();
            gpb_SystemManage.Controls.Add(ope);
        }

        private void 旅行社分类管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            traveltype.Show();
            gpb_SystemManage.Controls.Clear();
            gpb_SystemManage.Controls.Add(traveltype);
        }

        private void 旅行社资料管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            travel.Show();
            gpb_SystemManage.Controls.Clear();
            gpb_SystemManage.Controls.Add(travel);
            travel.LoadData();
            
        }

        private void 导游信息管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            guide.Show();
            gpb_SystemManage.Controls.Clear();
            gpb_SystemManage.Controls.Add(guide);
            guide.loaddata();
        }

        private void 角色权限管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            roleright.Show();
            gpb_SystemManage.Controls.Clear();
            gpb_SystemManage.Controls.Add(roleright);
        }

        private void 更换操作员ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
            System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location);
        }

        private void 修改操作员密码ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form_ModifyPwd mp = new Form_ModifyPwd();
            mp.Show();
        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void 操作员管理ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ope.Show();
            gpb_SystemManage.Controls.Clear();
            gpb_SystemManage.Controls.Add(ope);
        }

        private void 门票管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form_EditTicket fe = new Form_EditTicket();
            fe.Show();
        }
    }
}
